package singleton;

import org.junit.jupiter.api.Test;

/**
 * @Author Zhang Chao
 * @Date 2021/5/23 11:23
 * @Version 1.0
 */
public class TestDriver01 {
    @Test
    public void test01(){
        // 获取单例模式的实例对象
        SingletonDemo singletonDemo = SingletonDemo.getSingletonDemoInstance();
        SingletonDemo singletonDemo1 = SingletonDemo.getSingletonDemoInstance();
        // 判定内存中是不是同一个对象【地址是否一样】 == 判定
        System.out.println("singletonDemo1 == singletonDemo:" + (singletonDemo1 == singletonDemo));
    }
}
